<div class="hp-tab-newprd">
    <?php if(!is_iframe()){?>
    <ul class="j-sw-nav">
        <li class="newprd-s1 tab-li"><a href="<?php echo base_path();?>special_activities/list">查看</a></li>
        <?php if(user_access('add special_activities')){ ?>
        <li class="newprd-s2 tab-li<?php if(arg(1) == 'add'){?> on <?php }?>"><a href="<?php echo base_path();?>special_activities/add">添加</a></li>
        <?php } if(arg(1) == 'edit' && !empty(arg(2))){?>
            <li class="newprd-s3 tab-li on"><a href="javascript:void(0)">修改</a></li>
        <?php }?>
    </ul>
    <?php }?>
    <div class="table-div" >

        <div class="small-select small-input column" style="clear:both">
            <div class="big-input"><div class="form-label"><span class="required">*</span>专项活动:</div><?php print render($form['special_activities']); ?></div>
            <?php if(arg(1) == 'edit' && !empty(arg(2))){ ?>
            <div><div class="form-label">创建时间:</div><?php print render($form['timestamp']); ?></div>
            <?php }?>
            <div class="small-select big-input column" style="clear:both">
                <div class="form-label">实施大区:</div><?php print render( $form['implementation_region']); ?>
            </div>
            <div class="small-select big-input column" style="clear:both">
                <div class="form-label">实施地点:</div><?php print render( $form['implementation_place']); ?>
            </div>
            <div class="small-select big-input column" style="clear:both">
                <div class="form-label" style="margin-right:10px ">实施说明:</div><?php print render( $form['implementation_comment']); ?>
            </div>
            <p></p>
            <div class="small-select small-input column" style="clear:both">
                <div class="form-label">农民会议(场次):</div><?php print render( $form['farmer_meeting']); ?>
            </div>
            <div class="small-select small-input column" style="clear:both">
                <div class="form-label">经销商会议(场次):</div><?php print render( $form['distrbutor_meeting']); ?>
            </div>
            <div class="small-select small-input column" style="clear:both">
                <div class="form-label">示范肥数量(吨):</div><?php print render( $form['fertilizer_number']); ?>
            </div>
            <div class="column" style="clear:both">
                <div class="form-label">品种:</div>
                <div style="float: left"><?php print render( $form['fertilizer_type1']); ?></div>
                <div style="float: left"><?php print render( $form['fertilizer_type2']); ?></div>
                <div style="float: left"><?php print render( $form['fertilizer_type3']); ?></div>
                <div style="float: left"><?php print render( $form['fertilizer_type4']); ?></div>
                <div style="float: left"><?php print render( $form['fertilizer_type5']); ?></div>
            </div>
            <div class="small-select big-input column" style="clear:both">
                <div class="form-label">特色活动名称:</div><?php print render( $form['feature_name']); ?>
            </div>
<!--            <div class="small-select small-input column" style="clear:both">-->
<!--                <div class="form-label">实施数量:</div>--><?php //print render( $form['implementation_number']); ?>
<!--            </div>-->
        </div>
        <div class="add-submit" style="text-align: center"><?php print render($form['submit']); ?></div>
        <div style="clear: both"></div>
        <?php if(arg(1) == 'edit' && !empty(arg(2))){
                if(!empty($form['#special_activities'])){
                    if($form['#special_activities']['farmer']){ ?>
                        <div class="special-activities">
                            <div class="special-activities-title">农户信息</div>
                        <?php
                        foreach($form['#special_activities']['farmer'] as $key => $val){?>
                            <div class="special-activities-div">
                                <ul>
                                    <?php
                                        $address = get_all_addrname($val->addr_id);
                                    ?>
                                    <li>农户姓名：<?php echo $val->farmer_name; ?></li>
                                    <li>地址：<?php echo $address; ?></li>
                                    <li>详细地址：<?php echo $val->addr_details; ?></li>
                                    <li>电话号码：<?php echo $val->cell; ?></li>
                                </ul>
                            </div>
                        <?php } ?>
                        </div>
                    <?php }
                    if($form['#special_activities']['plant']){ ?>
                    <div class="special-activities">
                        <div class="special-activities-title">种植信息</div>
                        <?php
                        foreach($form['#special_activities']['plant'] as $key => $val){
//                            print_r($val);?>
                            <div class="special-activities-div">
                                <ul>
                                    <?php
                                    $address = get_all_addrname($val->addr_id);
                                    ?>
                                    <li>农户姓名：<?php echo $val->farmer_name; ?></li>
                                    <li>地址：<?php echo $address; ?></li>
                                    <li>作物：<?php echo $val->plant_name; ?></li>
                                    <li>播种日期：<?php echo $val->sow_date; ?></li>
                                    <li>收获日期：<?php echo $val->harvest_date; ?></li>
                                    <li>种植面积：<?php echo $val->plant_area; ?></li>
                                </ul>
                            </div>
                        <?php } ?>
                    </div>
                <?php }
                    if($form['#special_activities']['soil']){ ?>
                    <div class="special-activities">
                        <div class="special-activities-title">土壤信息</div>
                        <?php
                        foreach($form['#special_activities']['soil'] as $key => $val){
//                                print_r($val);?>
                            <div class="special-activities-div">
                                <ul>
                                    <?php
                                    $address = get_all_addrname($val->addr_id);
                                    ?>
                                    <li>农户姓名：<?php echo $val->farmer_name; ?></li>
                                    <li>地址：<?php echo $address; ?></li>
                                    <li>送样人：<?php echo $val->sampler; ?></li>
                                    <li>采样日期：<?php echo $val->sample_date; ?></li>
                                </ul>
                            </div>
                        <?php } ?>
                    </div>
                <?php }
                    if($form['#special_activities']['gift']){ ?>
                        <div class="special-activities">
                            <div class="special-activities-title">礼物信息</div>
                            <?php
                            foreach($form['#special_activities']['gift'] as $key => $val){
//                                print_r($val);?>
                                <div class="special-activities-div">
                                    <ul>
                                        <?php
                                        $address = get_all_addrname($val->addr_id);
                                        ?>
                                        <li>农户姓名：<?php echo $val->farmer_name; ?></li>
                                        <li>地址：<?php echo $address; ?></li>
                                        <li>数量：<?php echo $val->quantity; ?></li>
                                        <li>礼物类型：<?php echo   $val->gift_type == 1 ? '化肥': '代金券'; ?></li>
                                    </ul>
                                </div>
                            <?php } ?>
                        </div>
                    <?php }
                    if($form['#special_activities']['fertilizer']){ ?>
                        <div class="special-activities">
                            <div class="special-activities-title">施肥信息</div>
                            <?php
                            foreach($form['#special_activities']['fertilizer'] as $key => $val){
//                                print_r($val);?>
                                <div class="special-activities-div">
                                    <ul>
                                        <?php
                                        $address = get_all_addrname($val->addr_id);
                                        ?>
                                        <li>农户姓名：<?php echo $val->farmer_name; ?></li>
                                        <li>地址：<?php echo $address; ?></li>
                                        <li>作物：<?php echo $val->plant_name; ?></li>
                                        <li>实际产量：<?php echo $val->real_yield; ?></li>
                                    </ul>
                                </div>
                            <?php } ?>
                        </div>
                    <?php }
                    if($form['#special_activities']['revisit']){ ?>
                        <div class="special-activities">
                            <div class="special-activities-title">回访信息</div>
                            <?php
                            foreach($form['#special_activities']['revisit'] as $key => $val){
//                                print_r($val);?>
                                <div class="special-activities-div">
                                    <ul>
                                        <?php
                                        $address = get_all_addrname($val->addr_id);
                                        ?>
                                        <li>农户姓名：<?php echo $val->farmer_name; ?></li>
                                        <li>地址：<?php echo $address; ?></li>
                                        <li>作物：<?php echo $val->plant_name; ?></li>
                                        <li>回访日期：<?php echo $val->visit_date; ?></li>
                                        <li>单产量：<?php echo $val->unit_yield; ?></li>
                                        <li>纯收益：<?php echo $val->net_income; ?></li>
                                        <li>对照产量：<?php echo $val->contrast_yield; ?></li>
                                        <li>对照收益：<?php echo $val->contrast_income; ?></li>
                                    </ul>
                                </div>
                            <?php } ?>
                        </div>
                    <?php }
                    if($form['#special_activities']['plant_measure']){ ?>
                        <div class="special-activities">
                            <div class="special-activities-title">测产信息</div>
                            <?php
                            foreach($form['#special_activities']['plant_measure'] as $key => $val){
//                                print_r($val);?>
                                <div class="special-activities-div">
                                    <ul>
                                        <?php
                                        $address = get_all_addrname($val->addr_id);
                                        ?>
                                        <li>农户姓名：<?php echo $val->farmer_name; ?></li>
                                        <li>地址：<?php echo $address; ?></li>
                                        <li>作物：<?php echo $val->plant_name; ?></li>
                                        <li>测产时间：<?php echo $val->date; ?></li>
                                    </ul>
                                </div>
                            <?php } ?>
                        </div>
                    <?php }
                    if($form['#special_activities']['village']){ ?>
                        <div class="special-activities">
                            <div class="special-activities-title">村落信息</div>
                            <?php
                            foreach($form['#special_activities']['village'] as $key => $val){
//                                print_r($val);?>
                                <div class="special-activities-div">
                                    <ul>
                                        <?php
                                        $address = get_all_addrname($val->addr_id);
                                        ?>
                                        <li>经销商：<?php echo $val->distributor_name; ?></li>
                                        <li>地址：<?php echo $address; ?></li>
                                        <li>人口数：<?php echo $val->population; ?></li>
                                        <li>平均收入：<?php echo $val->income_average; ?></li>
                                        <li>耕地面积：<?php echo $val->farm_area; ?></li>
                                        <li>土壤情况：<?php echo $val->soil_condition; ?></li>
                                    </ul>
                                </div>
                            <?php } ?>
                        </div>
                    <?php }
                    if($form['#special_activities']['village_activity']){ ?>
                        <div class="special-activities">
                            <div class="special-activities-title">村落活动</div>
                            <?php
                            foreach($form['#special_activities']['village_activity'] as $key => $val){
//                                print_r($val);?>
                                <div class="special-activities-div">
                                    <ul>
                                        <?php
                                        $address = get_all_addrname($val->addr_id);
                                        ?>
                                        <li>经销商：<?php echo $val->distributor_name; ?></li>
                                        <li>地址：<?php echo $address; ?></li>
                                        <li>标题：<?php echo $val->title; ?></li>
                                        <li>活动日期：<?php echo $val->date; ?></li>
                                    </ul>
                                </div>
                            <?php } ?>
                        </div>
                    <?php }?>
                    <div style="clear: both"></div>



                <?php }?>
        <?php }?>
    </div>
</div>

<?php print drupal_render_children($form); ?>

